package com.rzl.expense.expense.service.impl;

import java.util.List;
import com.rzl.expense.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.rzl.expense.expense.mapper.EleContractHistoryMapper;
import com.rzl.expense.expense.domain.EleContractHistory;
import com.rzl.expense.expense.service.IEleContractHistoryService;

/**
 * 电费合同Service业务层处理
 * 
 * @author expense
 * @date 2025-01-09
 */
@Service
public class EleContractHistoryServiceImpl implements IEleContractHistoryService 
{
    @Autowired
    private EleContractHistoryMapper eleContractHistoryMapper;

    /**
     * 查询电费合同
     * 
     * @param elecontractBackupsId 电费合同主键
     * @return 电费合同
     */
    @Override
    public EleContractHistory selectEleContractHistoryByElecontractBackupsId(String elecontractBackupsId)
    {
        return eleContractHistoryMapper.selectEleContractHistoryByElecontractBackupsId(elecontractBackupsId);
    }

    /**
     * 查询电费合同列表
     * 
     * @param eleContractHistory 电费合同
     * @return 电费合同
     */
    @Override
    public List<EleContractHistory> selectEleContractHistoryList(EleContractHistory eleContractHistory)
    {
        return eleContractHistoryMapper.selectEleContractHistoryList(eleContractHistory);
    }

    /**
     * 新增电费合同
     * 
     * @param eleContractHistory 电费合同
     * @return 结果
     */
    @Override
    public int insertEleContractHistory(EleContractHistory eleContractHistory)
    {
        eleContractHistory.setCreateTime(DateUtils.getNowDate());
        return eleContractHistoryMapper.insertEleContractHistory(eleContractHistory);
    }

    /**
     * 修改电费合同
     * 
     * @param eleContractHistory 电费合同
     * @return 结果
     */
    @Override
    public int updateEleContractHistory(EleContractHistory eleContractHistory)
    {
        eleContractHistory.setUpdateTime(DateUtils.getNowDate());
        return eleContractHistoryMapper.updateEleContractHistory(eleContractHistory);
    }

    /**
     * 批量删除电费合同
     * 
     * @param elecontractBackupsIds 需要删除的电费合同主键
     * @return 结果
     */
    @Override
    public int deleteEleContractHistoryByElecontractBackupsIds(String[] elecontractBackupsIds)
    {
        return eleContractHistoryMapper.deleteEleContractHistoryByElecontractBackupsIds(elecontractBackupsIds);
    }

    /**
     * 删除电费合同信息
     * 
     * @param elecontractBackupsId 电费合同主键
     * @return 结果
     */
    @Override
    public int deleteEleContractHistory()
    {
        return eleContractHistoryMapper.deleteEleContractHistory();
    }




    @Override
    public void batchEleContractHistory(List<EleContractHistory> list)
    {

         eleContractHistoryMapper.batchEleContractHistory(list);
    }


}
